//package com.hyperchain.config.mq.work;
//
//
//import cn.hutool.core.util.StrUtil;
//import com.hyperchain.config.mq.RabbitMqConfig;
//import com.rabbitmq.client.Channel;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.io.IOException;
//
//@Component
//@Slf4j
//public class HelloReceiver {
//
//    @RabbitListener(queues = "q_hello")
//    public void listen(String object, Message message, Channel channel) {
//        long deliveryTag = message.getMessageProperties().getDeliveryTag();
//        try {
//            /**
//             * 执行业务代码...
//             * */
//            int i = 1 / 0;
//            log.info("消费成功：{},消息内容:{}", deliveryTag, object);
//            channel.basicAck(deliveryTag, false);
//        } catch (Exception e) {
//            log.error("签收失败", e);
//            try {
//                channel.basicNack(deliveryTag, false, true);
//            } catch (Exception exception) {
//                log.error("拒签失败", exception);
//            }
//        }
//    }
//
//
//}
//
//
